<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>css3边框与背景</title>
    <style>
        .demo1 {
            width: 100px;
            height: 100px;
            background: red;
            border:100px solid #000;
            /* stretch:若宽度超出border宽度的话 拉伸 
               repeat:若宽度超出border宽度的话 复制图片展示 
               round: （content宽度 / border相应位置的宽度）四舍五入
            */
            border-image: url('./image/1.jpg') 100 stretch;
        }
        .demo2 {
            width: 300px;
            height: 300px;
            background: url('./image/1.jpg') no-repeat red;
            background-origin: content-box;
            background-size: contain;
        }
    </style>
</head>
<body>
    <div class="demo1"></div>
    <div class="demo2"></div>
</body>
</html>